<?php $filepointer = fopen("/home/web1/mariokartchallenger.com/htdocs/sitemap.xml", "w");

fputs ($filepointer, '<?xml version="1.0" encoding="UTF-8"?>   <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">   <sitemap>      <loc>http://www.mariokartchallenger.com/sitemap1.xml</loc>   </sitemap>   <sitemap>      <loc>http://www.mariokartchallenger.com/sitemap2.xml</loc>   </sitemap>
   <sitemap>      <loc>http://www.mariokartchallenger.com/sitemap3.xml</loc>   </sitemap>
   <sitemap>      <loc>http://www.mariokartchallenger.com/sitemap4.xml</loc>   </sitemap>   </sitemapindex>');

fclose($filepointer);

$sitemap1 = fopen("/home/web1/mariokartchallenger.com/htdocs/sitemap1.xml", "w");

fputs ($sitemap1, '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">   <url>      <loc>http://www.mariokartchallenger.com/</loc>      <priority>1.0</priority>   </url>
   <url>      <loc>http://www.mariokartchallenger.com/index.php?act=news</loc>      <priority>1.0</priority>   </url>
   <url>      <loc>http://www.mariokartchallenger.com/index.php?act=search</loc>      <priority>1.0</priority>   </url>
   <url>      <loc>http://www.mariokartchallenger.com/register.php</loc>      <priority>1.0</priority>   </url>
   <url>      <loc>http://www.mariokartchallenger.com/pass.php</loc>      <priority>1.0</priority>   </url>
   <url>      <loc>http://www.mariokartchallenger.com/help.php</loc>      <priority>1.0</priority>   </url>
   <url>      <loc>http://www.mariokartchallenger.com/privacy.php</loc>      <priority>1.0</priority>   </url>
   <url>      <loc>http://www.mariokartchallenger.com/sitemap.php</loc>      <priority>1.0</priority>   </url>
   <url>      <loc>http://www.mariokartchallenger.com/about.php</loc>      <priority>1.0</priority>   </url>
   <url>      <loc>http://www.mariokartchallenger.com/http://www.mariokartchallenger.com/how-to-receive-messages-on-your-wii.php</loc>      <priority>1.0</priority>   </url>
   <url>      <loc>http://www.mariokartchallenger.com/where-do-i-find-my-friend-code.php</loc>      <priority>1.0</priority>   </url>
   </urlset>');

fclose($sitemap1);

$sitemap2 = fopen("/home/web1/mariokartchallenger.com/htdocs/sitemap2.xml", "w");

$query = "SELECT * FROM gamematch WHERE id != '' ORDER BY id DESC LIMIT 1000";
$result = mysql_query($query);

fputs ($sitemap2, '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');

while ($gameroomdata = mysql_fetch_array($result))
{
	fputs ($sitemap2, '<url><loc>http://www.mariokartchallenger.com/index.php?showroom=' . $gameroomdata[id]. '</loc><priority>1.0</priority></url>');
}

fputs ($sitemap2, '</urlset>');
fclose($sitemap2);


$sitemap3 = fopen("/home/web1/mariokartchallenger.com/htdocs/sitemap3.xml", "w");

$query = "SELECT * FROM user WHERE userid != '' ORDER BY userid DESC LIMIT 1000";
$result = mysql_query($query);

fputs ($sitemap3, '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');

while ($userdata = mysql_fetch_array($result))
{
	fputs ($sitemap3, '<url><loc>http://www.mariokartchallenger.com/index.php?showuser=' . $userdata[userid]. '</loc><priority>1.0</priority></url>');
}

fputs ($sitemap3, '</urlset>');
fclose($sitemap3);


$sitemap4 = fopen("/home/web1/mariokartchallenger.com/htdocs/sitemap4.xml", "w");

$query = "SELECT * FROM gamematch WHERE id != '' ORDER BY id DESC LIMIT 1000";
$result = mysql_query($query);

fputs ($sitemap4, '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');

while ($commentdata = mysql_fetch_array($result))
{
	fputs ($sitemap4, '<url><loc>http://www.mariokartchallenger.com/index.php?viewcomments=' . $commentdata[id]. '</loc><priority>1.0</priority></url>');
}

fputs ($sitemap4, '</urlset>');
fclose($sitemap4);
?>